package com.richest.api.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 读取配置文件
 * 
 * @author 赵鸿超 2017年9月24日
 */
public class ConfigureManager {
	private static Logger logger = LoggerFactory.getLogger(ConfigureManager.class);
	private InputStream inputStream;
	private Properties configureManager;

	public ConfigureManager() {

	}

	public ConfigureManager(String strConfigureFileName) {
		inputStream = ConfigureManager.class.getClassLoader().getResourceAsStream(strConfigureFileName);
		configureManager = new Properties();
		try {
			configureManager.load(inputStream);
		} catch (IOException e) {
			logger.debug("读取配置文件出错！");
			e.printStackTrace();
			logger.debug(e.getMessage(), e);
		}
	}

	public String getProperty(String strPropertiesName) {
		return configureManager.getProperty(strPropertiesName).trim();
	}
}
